package itheima.zuoye.Test4;

public class Person  implements Comparable<Person>{
    private int idCard;
    private String userName;

    public Person() {
    }

    public Person(int idCard, String userName) {
        this.idCard = idCard;
        this.userName = userName;
    }

    public int getIdCard() {
        return idCard;
    }

    public void setIdCard(int idCard) {
        this.idCard = idCard;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    @Override
    public String toString() {
        return "Person{" +
                "idCard=" + idCard +
                ", userName='" + userName + '\'' +
                '}';
    }

    @Override
    public int compareTo(Person o) {
        return  this.idCard - o.idCard;

    }
}
